package com.milk.model.entity.admin;

import java.io.Serializable;

public class Admin implements Serializable {

	/**
	* 
	*/
	private static final long serialVersionUID = 7904003906086278367L;

	public long id;
	public String name;
	public String username;
	public String password;
	public boolean administrator;
	public long roleId;
	
	public Admin(){
		
	}
	
	public Admin(long id,String name,String username,String password
			,boolean administrator,long roleId){
		this.id = id;
		this.name = name;
		this.username = username;
		this.password = password;
		this.administrator = administrator;
		this.roleId = roleId;
	}
	
	public Admin addName(String name){
		return new Admin(id,name,username,password,administrator,roleId);
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean isAdministrator() {
		return administrator;
	}

	public void setAdministrator(boolean administrator) {
		this.administrator = administrator;
	}

	public long getRoleId() {
		return roleId;
	}

	public void setRoleId(long roleId) {
		this.roleId = roleId;
	}
	
	/**
	 * admin 的查询视图
	 * @author vi
	 *
	 */
	public static class AdminView {

		public final long id;
		
		public final String name;
		
		public final String username;
		public final String password;
		public final boolean administrator;
		public final long roleId;
		
		public AdminView(long id,String name,String username
				,String password,boolean administrator,long roleId){
			this.id = id;
			this.name = name;
			this.username = username;
			this.password = password;
			this.administrator = administrator;
			this.roleId = roleId;
		}
	}
}
